/*
 * File:    DataTypes.h
 * Project:	HobbyPilotFirmware (HPF)
 * Author:  Wouter van Verre
 *
 * Created on February 8, 2011, 10:35 PM
 */
 
#ifndef __DATATYPES_H
#define __DATATYPES_H

/** Typedefines **/
typedef unsigned char uint8;
typedef unsigned int uint16;
typedef unsigned long uint32;
typedef char int8;
typedef int  int16;
typedef long int32;

/** Structures **/
struct TwoUInt8
{
	uint8 a;
	uint8 b;
};

struct TwoInt8
{
	int8 a;
	int8 b;
};

struct FourUInt8
{
	uint8 a;
	uint8 b;
	uint8 c;
	uint8 d;
};

struct FourInt8
{
	int8 a;
	int8 b;
	int8 c;
	int8 d;
};

struct TwoInt16
{
	int16 a;
	int16 b;
};

struct TwoUint16
{
	uint16 a;
	uint16 b;
};

/** Unions **/
union SplitFloat
{
	float value;
	struct FourUInt8 uint8;
};

union SplitInt16
{
	int16 value;
	struct TwoInt8 int8;
	struct TwoUInt8 uint8;
};

union SplitInt32
{
	int32 value;
	struct TwoInt16 int16;
	struct FourInt8 int8;
	struct FourUInt8 uint8;
};

#endif
